package com.mobile.paperazi;

import java.util.ArrayList;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.mobile.paperazi.data.Content;

public class OptionPopupArrayAdapter extends ArrayAdapter<Content> {
	
	private final Context context;
	private final ArrayList<Content> values;
	
	public OptionPopupArrayAdapter(Context context, ArrayList<Content> values) {
		super(context, R.layout.row_layout, values );
		this.context = context;
		this.values = values;
		
	}
	
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		LayoutInflater inflater = (LayoutInflater) context
				.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		View rowView = inflater.inflate(R.layout.row_layout, parent, false);
		TextView textView = (TextView) rowView.findViewById(R.id.contentTitle);
		textView.setText(values.get(position).getTitle());
//		TextView textViewUrl = (TextView) rowView.findViewById(R.id.contentUrl);
//		textViewUrl.setText(values.get(position).getUrl());
		return rowView;
	}

}
